<div id="page_content">
    <?= '<h2>' . $this->t->_('List of add-ons') . '</h2>' ?>
    <div id="pages_list">
        <ul>
            <li><div class="i_module"><?= $this->t->_('Modules') ?></div>
                <ul>
                    <?php
                    foreach ($this->modules as $value) {
                        echo '<li><div class="i_' . $value->title . '">';
                        $this->t->_($value->name);
                        echo '<a href="' . ADMIN_URL . '/settings/module/name/' . $value->title . '">' . $this->t->_($value->name) . '</a>';

                        if (method_exists(ucfirst($value->title) . 'Controller', 'settingsAction')) {
                            echo '<a href="' . ADMIN_URL . '/addons/settings/module/' . $value->title . '" title="' . $this->t->_("Settings") . '" class="nav_button setting_button"></a>';
                        }
                        echo '<a href="#" id="' . ADMIN_URL . '/addons/delete/id/' . $value->id . '" title="' . $this->t->_("Delete") . '" id="delete_action" class="nav_button delete_button"></a>';
                        echo '&nbsp;</div></li>';
                    }
                    ?>
                </ul>
            </li>
            <li><div class="i_language"><?= $this->t->_('Languages') ?></div>
                <ul>
                    <?php
                    foreach ($this->languages as $value) {
                        echo '<li><div class="i_language">';
                        $this->t->_($value->name);
                        echo '<a href="#">' . $value->name . '</a>';
                        echo '<a href="#" id="' . ADMIN_URL . '/addons/delete/id/' . $value->id . '" title="' . $this->t->_("Delete") . '" id="delete_action" class="nav_button delete_button"></a>';
                        echo '&nbsp;</div></li>';
                    }
                    ?>
                </ul>
            </li>
            <li><div class="i_template"><?= $this->t->_('Templates') ?></div>
                <ul>
                    <?php
                    foreach ($this->templates as $value) {
                        echo '<li><div class="i_template">';
                        $this->t->_($value->name);
                        echo '<a href="#">' . $value->name . '</a>';
                        echo '<a href="#" id="' . ADMIN_URL . '/addons/delete/id/' . $value->id . '" title="' . $this->t->_("Delete") . '" id="delete_action" class="nav_button delete_button"></a>';
                        echo '&nbsp;</div></li>';
                    } ?>
                </ul>
            </li>
        </ul>
    </div>
    <?= '<h2>' . $this->t->_('New add-on') . '</h2>' . $this->form ?>
</div>
<script type="text/javascript">
    $(function() {
        $("#pages_list").treeview({
            persist: "location",
            collapsed: true,
            unique: false
        });
        $("li > div > a").nextAll().hide();
        $("li > div").hover(
        function () {
            $('> a',this).nextAll().show();
        },
        function () {
            $('> a',this).nextAll().hide();
        }
    );
    });
</script>